import {sendMessageToMobileOrEmail} from '@/api/commons'
//引入登录 api 接口

//用户状态管理模块
const commonsService = {
    actions: {
        SendMessageToMobileOrEmail({commit}, regUser) { //定义 Login 方法，在组件中使用 this.$store.dispatch("Login") 调用
            //console.log('in moutains SendMessageToMobileOrEmail,token='+token);
            return new Promise((resolve, reject) => { //封装一个 Promise
                sendMessageToMobileOrEmail(regUser.identify, regUser.token).then(response => { //使用 members 接口进行网络请求
                    resolve(response) //将结果封装进 Promise
                }).catch(error => {
                    reject(error)
                })
            })
        }
    }
}

export default commonsService;